package org.oslims.server.dao.hbm;

import java.util.List;

import org.hibernate.Query;
import org.oslims.domain.Report;
import org.oslims.domain.Request;
import org.oslims.server.dao.ReportDao;

public class HbmReportDao extends HbmGenericDao<Report, Long> implements ReportDao {

	@SuppressWarnings("unchecked")
	@Override
	public List<Report> findByRequest(Request request) {
		Query q = this.getSession().createQuery("select report from Report report where report.request.id = :requestId");
		q.setLong("requestId", request.getId());
		return q.list();
	}

}
